<template>
    <el-link v-bind="elProps" :style="elStyles" v-on="elEvents">
        {{ config.props.slot }}
    </el-link>
</template>

<script lang="ts" setup>
import { computed } from 'vue';
import type { PropType } from 'vue';
import { omit } from 'lodash-es';
import type { ComponentType } from '@/materials/index.d';

defineOptions({
    name: "Link",
})

const props = defineProps({
    config: {
        type: Object as PropType<ComponentType>,
        required: true
    }
});

const elProps = computed(() => omit(props.config.props, ["slot"]));
const elStyles = computed(() => props.config.styles);
const elEvents = computed(() => props.config.events);
</script>